<template>
	<view class="home">
		<web-view :webview-styles="webviewStyles" :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "",
				pinyin: "",
				bihua: 0,
				url: "",
				webviewStyles: {
					progress: {
						color: '#FF3333'
					}
				}
			}
		},
		onLoad(e) {
			this.title = e.word;
			var self = this;
			this.url = "http://zidian.aies.cn/?q=" + e.word
		},
		methods: {
			lightName(name) {
				if (this.pinyin && name && name.length > 0) {
					return name.replaceAll(
						this.pinyin,
						"<span style='color: #5584E8;'>" + this.pinyin + "</span>"
					).replaceAll("\n", "<br>");
				} else {
					return ""
				}
			},
		}
	}
</script>

<style lang="scss">
	.home {
		display: flex;
		flex-direction: column;

		.title {
			align-self: center;
			color: green;
			font-size: 22px;
		}

	}
</style>
